package com.example.redislock.controller;

import com.example.redislock.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
 * @ClassName DemoController
 * @Description
 * @Author zhangsw
 * @Date 2020/11/10 19:42
 * @Version 1.0
 */
@RestController
public class DemoController {

//    @Autowired
//    DemoService demoService;

    @GetMapping("demo")
    public String demo() {
        Map<String, String> map = new HashMap<>();
        map.put("phone_no", "11111111111");
        map.put("yq_code", UUID.randomUUID().toString().substring(0, 8));
        Map<String, String> map2 = new HashMap<>();
        map2.put("phone_no", "11111111111");
        map2.put("yq_code", "88888888");
//        demoService.insertAndUpdate(map, map2);
        System.out.println("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
        return "ok";
    }

//    @GetMapping("returnJSON")
//    public Object returnJSON() {
//        return "{\n" +
//                "  \"paramz\": {\n" +
//                "    \"feeds\": [\n" +
//                "      {\n" +
//                "        \"id\": 299076,\n" +
//                "        \"oid\": 288340,\n" +
//                "        \"category\": \"article\",\n" +
//                "        \"data\": {\n" +
//                "          \"subject\": \"荔枝新闻3.0：不止是阅读\",\n" +
//                "          \"summary\": \"江苏广电旗下资讯类手机应用“荔枝新闻”于近期推出全新升级换代的3.0版。\",\n" +
//                "          \"cover\": \"/Attachs/Article/288340/3e8e2c397c70469f8845fad73aa38165_padmini.JPG\",\n" +
//                "          \"pic\": \"\",\n" +
//                "          \"format\": \"txt\",\n" +
//                "          \"changed\": \"2015-09-22 16:01:41\"\n" +
//                "        }\n" +
//                "      }\n" +
//                "    ],\n" +
//                "    \"PageIndex\": 1,\n" +
//                "    \"PageSize\": 20,\n" +
//                "    \"TotalCount\": 53521,\n" +
//                "    \"TotalPage\": 2677\n" +
//                "  }\n" +
//                "}";
//    }

}
